home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d21
/
dvglue.arc
/
TVFREE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-01-09
|
1KB
|
36 lines
/*================================================*/
/* TVFREE.C */
/* */
/* (c) Copyright 1988 Ralf Brown */
/* All Rights Reserved */
/* May be freely copied for noncommercial use as */
/* long as this copyright notice is kept intact */
/* and any changes are indicated in the comment */
/* blocks for the functions */
/*================================================*/
#include "tvapi.h"
#undef free
/*================================================*/
extern OBJECT _TV_alloc_mutex_ ;
/*================================================*/
/* _TV_free version of free() which is safe in */
/* the presence of multiple threads */
/* Ralf Brown 5/10/88 */
/*================================================*/
void _TV_free(void *block)
{
if (!TVisobj(_TV_alloc_mutex_))
_TV_alloc_mutex_ = TVmbx_new() ;
TVlock(_TV_alloc_mutex_) ; /* make sure we only have one thread at a time */
free(block) ; /* in the memory allocation routines */
TVunlock(_TV_alloc_mutex_) ;
}
/* End of TVFREE.C */